#!/usr/bin/python
# coding:utf-8
from ..config.baseConfig import config


class Config(config):
    # Flask
    host = '127.0.0.1'
    DEBUG = True
    # Database
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:8986927223@localhost/melog?charset=utf8'

    JSON_AS_ASCII = True
    #
    MAIL_SERVER = "smtp.yeah.net"
    MAIL_PORT = 25
    MAIL_USE_TLS = True
    MAIL_USE_SSL = False
    MAIL_USERNAME = 'xiaoi2008@yeah.net'
    MAIL_PASSWORD = 'UrdqZ9Xx3K'
    MAIL_DEBUG = True
    # SNS
    SOCIAL_CONFIG = {
        'weibo': {
            'id': '2033652754',
            'name': 'weibo',
            'secret': 'c87b37d80b5546c348ec1752d991e4be',
            'oauth': {
                'version': 2,
                'auth': 'https://api.weibo.com/oauth2/authorize',
                'grant': 'https://api.weibo.com/oauth2/access_token',
                'scope': {
                    'all': 'all',  # 请求下列所有scope权限
                    'email': 'email',  # 用户的联系邮箱
                    'direct_messages_write': 'direct_messages_write',  # 私信发送接口
                    'direct_messages_read': 'direct_messages_read',  # 私信读取接口
                    'invitation_write': 'invitation_write',  # 邀请发送接口
                    'friendships_groups_read': 'friendships_groups_read',  # 好友分组读取接口组
                    'friendships_groups_write': 'friendships_groups_write',  # 好友分组写入接口组
                    'statuses_to_me_read': 'statuses_to_me_read',  # 定向微博读取接口组
                    'follow_app_official_microblog': 'follow_app_official_microblog'
                    # 关注应用官方微博，该参数不对应具体接口，只需在应用控制台填写官方帐号即可。填写的路径：我的应用-选择自己的应用-应用信息-基本信息-官方运营账号（默认值是应用开发者帐号）
                },
                'response_type': 'code',
                'response_kind': 'post',
                'grant_type': 'authorization_code',
                'grant_kind': 'post'
            },
            'grant': 'https://api.weibo.com/oauth2/access_token',
            'grandMethod': 'post-params',
            'base': 'https://api.weibo.com/2/',
            'api': {
                'me': ('user', 'get')
            }
        },
        'github': {
            'id': '3eeab94042f0cb567195',
            'name': 'github',
            'secret': 'dd0394d5b292f8518398eacfe1363c65688f54c1',
            'oauth': {
                'version': 2,
                'auth': 'https://github.com/login/oauth/authorize',
                'grant': 'https://github.com/login/oauth/access_token',
                'scope': {
                    'email': 'user:email'  # 用户的联系邮箱
                }
            },
            'grandMethod': 'post-params',
            'base': 'https://api.github.com/',
            'api': {
                'me': ('user', 'get')
            }
        },
        'google': {
            'id': '872992505441-ukcv5bqt5pigi1jna6q699gm1uce3qh0.apps.googleusercontent.com',
            'name': 'google+',
            'secret': 'Kqq_2l5dvbnbX1hBZIab7nEo',
            'oauth': {
                'version': 2,
                'auth': 'https://accounts.google.com/o/oauth2/auth',
                'grant': 'https://accounts.google.com/o/oauth2/token',
                'scope': {
                    'basic': 'https://www.googleapis.com/auth/plus.me profile',
                    'email': 'email',
                    'birthday': '',
                    'events': '',
                    'photos': 'https://picasaweb.google.com/data/',
                    'videos': 'http://gdata.youtube.com',
                    'friends': 'https://www.google.com/m8/feeds, https://www.googleapis.com/auth/plus.login',
                    'files': 'https://www.googleapis.com/auth/drive.readonly',
                    'publish': '',
                    'publish_files': 'https://www.googleapis.com/auth/drive',
                    'share': '',
                    'create_event': '',
                    'offline_access': ''
                },
            },
            'grandMethod': 'post-form',
            'base': 'https://www.googleapis.com/',
            'api': {
                'me': ('plus/v1/people/me', 'get')
            }
        }
    }
